package org.springblade.modules.platform.vo.enums;

import java.util.HashMap;
import java.util.Map;

public enum LogTypeEnum {

	PROPERTYREPORT(1,"属性上报"),
	ATTRIBUTEREAD(2,"属性读取"),
	PROPERTYMODIFICATIO(3,"属性修改"),
	TRANSFER(4,"调用"),
	REPLY(5,"回复"),
	OFFLINE(6,"下线"),
	ONLINE(7,"上线"),
	OTHER(8,"其他"),
	;



	private Integer code;
	private String msg;

	private static Map<Integer, LogTypeEnum> valueMap;

	static {
		valueMap = new HashMap<>();
		for (LogTypeEnum e : values()){
			valueMap.put(e.code, e);
		}
	}
	LogTypeEnum(int code, String msg){
		this.code = code;
		this.msg = msg;
	}
	public static LogTypeEnum getEnum(int key) {
		if (!valueMap.containsKey(key)) {
			return null;
		}
		return valueMap.get(key);
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
